package com.csthink.web.infrastructure.mq.consumer;

import lombok.extern.slf4j.Slf4j;
import org.apache.rocketmq.spring.annotation.RocketMQMessageListener;
import org.springframework.stereotype.Component;

import static com.csthink.web.infrastructure.constant.AsyncMQConstants.ROCKETMQ_TAG_ADD;

/**
 * @author <a href="mailto:security.2009@live.cn">Mars</a>
 * @since 2023-09-07
 */
@Slf4j
@Component
@RocketMQMessageListener(consumerGroup = "group_rocketmq",
        topic = "${async.mq.rocket.subscriber.topic.practice-practice}",
        selectorExpression = ROCKETMQ_TAG_ADD)
public class RocketMQListener implements org.apache.rocketmq.spring.core.RocketMQListener<String> {
    @Override
    public void onMessage(String msg) {
        log.info("RocketMQConsumer received messages :" + msg);
    }
}
